newrequest = true;

function checkAdf($link){
    var zipDomain = ['q.gs', 'adf.ly', 'j.gs', 'linkbucks.com', 'holidays-in-sardinia.it', 'cur.lv', 'zoow.it', 'bit.ly', 'sh.st', 'bc.vc', 'tantejulia.be', 'adf.tuhoctoan.net', 'any.gs', 'adf.ly', 'yyv.co', 'qqc.co', 'goopet-theorg.cu.cc'];
        for(var once in zipDomain){
            var onceD = zipDomain[once];
            if($link.indexOf(onceD) > -1 && $link.indexOf('getidn.asia/f') < 0){
                $link = $link.replace('http://minhshop.net/zip.php?link=', '');
                $link = $link.replace('adf.ly', '13');
                $link = $link.replace('http://', '');
                $link = $link.replace('www', '');
                $link = $link.replace(onceD, once);
                return ($link);
            }
        }
    return false;
}
function repalceLink($link){
    if($link.indexOf('google.com.vn') == -1){
        $link = $link.replace('http://minhshop.net/zip.php?link=', '');
        $link = $link.replace('http://getidn.asia/f/', '');
        $link = $link.replace('http://', '');
        $link = $link.replace('www', '');
        $link = $link.replace('/', ':');
        $link = $link.replace('.com', 'cn0c');
        $link = $link.replace('adfoc.us', 'cn0as');
        $link = $link.replace('.net', 'cn0n');
        $link = $link.replace('.org', 'cn0o');
        $link = $link.replace('.biz', 'cn0b');
        $link = $link.replace('.info', 'cn0i');
        $link = $link.replace('.co', 'cn0k');
        $link = $link.replace('.us', 'cn0u');
        $link = $link.replace('.gs', 'cn0g');
    }
    return ($link);
}

jQuery().ready(function($){
    var siteURL = ($(document).parent().context.referrer);
    //if(siteURL.indexOf('/getidn.asia') < 0 && siteURL.indexOf('cbox.ws/admin.php') < 0) {parent.window.location = 'http://getidn.asia/';}

    $('tr').live('mouseenter', function(e){
        var t = $(this);
        var id = t.attr('id');
        if(id != '-1'){
            /*
            var l = l2 = l3 = $('a[target=_blank]:eq(0):not(".zipped")', t);
            if($('a[target=_blank]:eq(1):not(".zipped")', t).length >0)
            l2 = $('a[target=_blank]:eq(1):not(".zipped")', t);
			if($('a[target=_blank]:eq(2):not(".zipped")', t).length >0)
			l3 = $('a[target=_blank]:eq(2):not(".zipped")', t);
            var href = l.attr('href');
            var href2 = l2.attr('href');
            var href3 = l3.attr('href');
            var domain_id = checkAdf(href);
            var domain_id2 = checkAdf(href2);
            var domain_id3 = checkAdf(href3);
            */
            var l = $('a[target=_blank]:not(".zipped")', t);
            l.each(function(i, el){
                var h = $(this);
                var href = h.attr('href');
                var domain_id = checkAdf(href);
                if(domain_id != false){
                    var encu = encodeURIComponent(domain_id);
                    var newZipURL = 'http://getidn.asia/f/'+decodeURIComponent(encu).replace('/', ':');
                    h.attr('href', newZipURL).addClass('zipped');
                }
                else{
                    if($('.pn_mod', t).length > 0 || $('.pn_vip1', t).length > 0  || $('.pn_vip2', t).length > 0  || $('.pn_gspam', t).length > 0 || $('.pn_gmb', t).length > 0
					|| (t.html()).indexOf('giay2bot') > -1 || (t.html()).indexOf('Cik') > -1 || (t.html()).indexOf('.uploaded.net.') > -1){
                        var newLink = repalceLink(href);
                        var encu = encodeURIComponent(newLink);
                        var newZipURL = 'http://getidn.asia/f/'+decodeURIComponent(encu);
                        h.attr('href', newZipURL).addClass('zipped');
                    }
                }
            });

        }
    });
});